package Paineis;

import java.awt.Graphics;

import java.awt.image.BufferedImage;

import Main.GamePanel;
import Utils.Utilidades;

public class ToolTypes {
	
	int x, y;
	final BufferedImage image;
	int posXDesenho, posYDesenho;
	

	public ToolTypes(int X, int Y, String FileName) {
		x= X;
		y = Y;
		image = Utilidades.LoadImage("/bildsTorres/"+FileName);
		
	}
	
	public void  setPosition(int X, int Y){
		x= X;
		y = Y;
	}
	
	public void draw(Graphics dbg){
		if(y-image.getHeight()>0){
			posYDesenho = y -image.getHeight();
		}else{
			posYDesenho = y;
		}
		if(x+image.getWidth()>GamePanel.PWIDTH){
			posXDesenho = x-image.getWidth();
		}else{
			posXDesenho = x;
		}
		
		dbg.drawImage(image, posXDesenho, posYDesenho, null);
	}

}
